package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 消息对象 message
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
public class Message extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 消息ID */
    private String id;

    /** 所属会话ID，关联user_session表的id */
    @Excel(name = "所属会话ID，关联user_session表的id")
    private String conversationId;

    /** 发送者ID */
    @Excel(name = "发送者ID")
    private Long senderId;

    /** 接收者ID */
    @Excel(name = "接收者ID")
    private Long receiverId;

    /** 消息类型：1=文字，2=图片，3=文件，4=引用消息，5=转发消息 */
    @Excel(name = "消息类型：1=文字，2=图片，3=文件，4=引用消息，5=转发消息")
    private Integer messageType;

    /** 消息内容 */
    @Excel(name = "消息内容")
    private String content;

    /** 发送状态：0=发送中，1=已发送，2=已撤回，3=已删除 */
    @Excel(name = "发送状态：0=发送中，1=已发送，2=已撤回，3=已删除")
    private Integer senderStatus;

    /** 被引用的消息ID，关联message表自身，仅message_type=4时有效 */
    @Excel(name = "被引用的消息ID，关联message表自身，仅message_type=4时有效")
    private String quoteMessageId;

    /** 转发来源消息ID，关联forward_message表，仅message_type=5时有效 */
    @Excel(name = "转发来源消息ID，关联forward_message表，仅message_type=5时有效")
    private String forwardFromId;

    /** 文件名，仅文件类型消息有效 */
    @Excel(name = "文件名，仅文件类型消息有效")
    private String fileName;

    /** 文件大小，单位字节，仅文件类型消息有效 */
    @Excel(name = "文件大小，单位字节，仅文件类型消息有效")
    private Long fileSize;

    /** 文件类型，仅文件类型消息有效 */
    @Excel(name = "文件类型，仅文件类型消息有效")
    private String fileType;

    /** 一对一已读状态：0=未读，1=已读，群聊已读通过group_member表记录 */
    @Excel(name = "一对一已读状态：0=未读，1=已读，群聊已读通过group_member表记录")
    private Integer isRead;

    /** 撤回时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "撤回时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date revokeTime;

    /** 删除时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deleteTime;

    /** 是否删除：0-未删除，1-已删除 */
    @Excel(name = "是否删除：0-未删除，1-已删除")
    private Integer isDeleted;

    /** 版本号，用于乐观锁 */
    @Excel(name = "版本号，用于乐观锁")
    private Long version;

    /** 创建人 */
    @Excel(name = "创建人")
    private String creator;
    /** 是否同步 0表示未同步   1 表示已同步*/
    @Excel(name = "是否同步")
    private Integer isSync;
    /** 发送时间 */
    @Excel(name = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;


    public Integer getIsSync() {
        return isSync;
    }

    public void setIsSync(Integer isSync) {
        this.isSync = isSync;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getSenderId() {
        return senderId;
    }

    public void setSenderId(Long senderId) {
        this.senderId = senderId;
    }

    public Long getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(Long receiverId) {
        this.receiverId = receiverId;
    }

    public void setConversationId(String conversationId)
    {
        this.conversationId = conversationId;
    }

    public String getConversationId() 
    {
        return conversationId;
    }




    public void setContent(String content) 
    {
        this.content = content;
    }

    public String getContent() 
    {
        return content;
    }




    public void setForwardFromId(String forwardFromId) 
    {
        this.forwardFromId = forwardFromId;
    }

    public String getForwardFromId() 
    {
        return forwardFromId;
    }

    public void setFileName(String fileName) 
    {
        this.fileName = fileName;
    }

    public String getFileName() 
    {
        return fileName;
    }

    public void setFileSize(Long fileSize) 
    {
        this.fileSize = fileSize;
    }

    public Long getFileSize() 
    {
        return fileSize;
    }

    public void setFileType(String fileType) 
    {
        this.fileType = fileType;
    }

    public String getFileType() 
    {
        return fileType;
    }

    public Integer getMessageType() {
        return messageType;
    }

    public void setMessageType(Integer messageType) {
        this.messageType = messageType;
    }

    public Integer getSenderStatus() {
        return senderStatus;
    }

    public void setSenderStatus(Integer senderStatus) {
        this.senderStatus = senderStatus;
    }

    public String getQuoteMessageId() {
        return quoteMessageId;
    }

    public void setQuoteMessageId(String quoteMessageId) {
        this.quoteMessageId = quoteMessageId;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public void setRevokeTime(Date revokeTime)
    {
        this.revokeTime = revokeTime;
    }

    public Date getRevokeTime() 
    {
        return revokeTime;
    }

    public void setDeleteTime(Date deleteTime) 
    {
        this.deleteTime = deleteTime;
    }

    public Date getDeleteTime() 
    {
        return deleteTime;
    }

    public void setIsDeleted(Integer isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() 
    {
        return isDeleted;
    }

    public void setVersion(Long version) 
    {
        this.version = version;
    }

    public Long getVersion() 
    {
        return version;
    }

    public void setCreator(String creator) 
    {
        this.creator = creator;
    }

    public String getCreator() 
    {
        return creator;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("conversationId", getConversationId())
            .append("senderId", getSenderId())
            .append("receiverId", getReceiverId())
            .append("messageType", getMessageType())
            .append("content", getContent())
            .append("senderStatus", getSenderStatus())
            .append("quoteMessageId", getQuoteMessageId())
            .append("forwardFromId", getForwardFromId())
            .append("fileName", getFileName())
            .append("fileSize", getFileSize())
            .append("fileType", getFileType())
            .append("isRead", getIsRead())
            .append("revokeTime", getRevokeTime())
            .append("deleteTime", getDeleteTime())
            .append("isDeleted", getIsDeleted())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("creator", getCreator())
            .toString();
    }
}
